perm filename TAK.TIM[TIM,LSP]4 blob
sn#640441 filedate 1982-02-11 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00009 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 Takeuchi function of various types
C00005 00003 ∂09-Dec-81 0453 Griss at UTAH-20 (Martin.Griss) TAK
C00007 00004 ∂14-Nov-81 0857 Daniel L. Weinreb <dlw at MIT-AI>
C00011 00005 ∂11-Dec-81 1126 Griss at UTAH-20 (Martin.Griss)
C00035 00006 MacLisp produced LAP
C00037 00007 ∂26-Feb-81 2227 CSVAX.fateman at Berkeley
C00039 00008 ∂22-Jan-82 1656 Griss at UTAH-20 (Martin.Griss) Latest V2 VAx times
C00041 00009 ∂23-Jan-82 0931 Griss at UTAH-20 (Martin.Griss) Rep to george
C00048 ENDMK
C⊗;
Takeuchi function of various types
tak (18. 12. 6.)
On 11/750 in Franz ordinary arith 19.9 seconds compiled
On Dolphin in InterLisp Nov 1981 (tr) 11.195 seconds compiled
On 11/750 in PSL, generic arith 7.1 seconds compiled
On Dolphin in InterLisp Jan 1982 (tr) 5.71 seconds compiled
On Vax 11/780 in InterLisp (load = 0) 4.24 seconds compiled
On Foonly F2 in MacLisp 4.1 seconds compiled
On Apollo (MC68000) PASCAL 3.8 seconds
On 11/750 in Franz, Fixnum arith 3.6 seconds compiled
On MIT CADR in ZetaLisp 3.1 seconds compiled
On Apollo (MC68000) PSL SYSLISP 2.93 seconds compiled
On 11/750 in C 2.4 seconds
On 11/780 (Diablo) in Franz 2.1 seconds compiled
On 68000 in C 1.9 second
On Utah-20 in PSL Generic arith 1.672 seconds compiled
On 11/750 in PSL INUM arith 1.4 seconds compiled
On 11/780 (Diablo) in C 1.35 seconds
On UTAH-20 in Lisp 1.6 1.1 seconds compiled
On UTAH-20 in PSL Inum arith 1.077 seconds compiled
On SAIL (KL) in MacLisp .83 seconds compiled
On SAIL in bummed MacLisp .79 seconds compiled
On 68000 in machine language .7 seconds
On Dorado in InterLisp Jan 1982 (tr) .53 seconds compiled
On UTAH-20 in SYSLISP arith .526 seconds compiled
On SAIL in machine language .255 seconds (wholine)
On SAIL in machine language .184 seconds (ebox-does not include mem)
On SCORE (2060) in machine language .162 seconds (ebox)
On S-1 Mark I in machine language .114 seconds (ebox & ibox)
47707 function calls
max recursion depth is 18
average recursion depth is 15.4
(defun tak (x y z)
(cond ((not (< y x))
z)
(t (tak (tak (1- x) y z)
(tak (1- y) z x)
(tak (1- z) x y))))))
notes:
(tr) means Tail Recursion Removal
∂09-Dec-81 0453 Griss at UTAH-20 (Martin.Griss) TAK
Date: 9 Dec 1981 0552-MST
From: Griss at UTAH-20 (Martin.Griss)
Subject: TAK
To: RPG at SU-AI
cc: griss at UTAH-20
JUST TO CONFIRM, (TAK 18 12 6), right?
I find times ranging form 0.55 sec to 3.5 sec depending on what sort of arith I
use: 0.55 is SYSLISP arith (unbox on entry, do opencoded arith), to full geeneric
arith.
On old LISP 1.6 system, we get about 1 sec, no fast arith.
I may try to make some macros for fast (Inum ?) arith; pretty easy,
simply define as sequence like:
(DM + (X)
`(BOX (WPLUS2 (UNBOX ,(CADR X)) (UNBOX ,(CADDR X)))))
where I just have to decide how cavalier I want to be about BOX and UNBOX,
ie INUM only, FIXNUMS too, With/without inline tag test...
What times do you find for (TAK 18 12 6), with some of these considerations.
Ill look at some code listing, FTP later today.
-------
Yes. (TAK 18. 12. 6.). Can you get an accurate number for Lisp 1.6?
Also, I'd like to look at the output of the compiler on this.
Thanks.
∂14-Nov-81 0857 Daniel L. Weinreb <dlw at MIT-AI>
Date: 14 November 1981 11:45-EST
From: Daniel L. Weinreb <dlw at MIT-AI>
To: RPG at SU-AI
Regarding the Takeuchi benchmark results:
The figure for "On the Dolphin" does not mean much if you don't say
which version of the software you were using. Masinter has been working
on performance improvements to the subroutine calling lately, and if you
don't make it clear whether your figure predates or postdates his work,
it is impossible to interpret it.
You might be interested to note that the Interlisp-D compiler, used on
the Dolphin, does a recursion removal on this function, doing the final
(tail-recursive outer) call to "tak" with a goto.
People in general seem to think that this is a worthless benchmark
because it is so small and tests such a small and specific set of
features, although I think that it is still worth something despite that
fact.
Masinter thinks that the only benchmarks that are worth considering are
wall-clock times. He has a benchmark of the KLONE system, showing its
wall-clock times on the Dolphin, and on a 20 (or KL-10?) under various
different load levels (measured in TOPS-20 "load average" units). His
figures show that the Dolphin equals a 20 (KL-10? I can't remember)
under a load average of 1.5. (He also shows the measured runtimes for
the 20, which are quite a bit lower than the wall-clock times even for
an unloaded 20). I think Masinter has a good point here, and I think
that this benchmark, both because of the method of timing and because it
is a real,large program is a much more significant benchmark than
anything else I have seen. That is, if I were evaluating machines, it
would impress me a lot more than values of measured runtime for "tak".
BAK is going to work on bringing up a large real Interlisp program for
ISI on Lisp Machines. Maybe we can use this to create similar
benchmarks for LM-2's. I'm not sure it can, because I think maybe the
thing BAK is converting is not a standalone application but rather is a
programming system that extendes other programs. I'll try to ask him
about it.
-- Dan
∂11-Dec-81 1126 Griss at UTAH-20 (Martin.Griss)
Date: 11 Dec 1981 1223-MST
From: Griss at UTAH-20 (Martin.Griss)
To: RPG at SU-AI
cc: Griss at UTAH-20
In-Reply-To: Your message of 11-Dec-81 1212-MST
And here is 1.6 speed, using our compiler, no fast-arith
(maybe can do with Fast ARith, If I can find the apckage):
[PHOTO: Recording initiated Wed 9-Dec-81 5:25AM]
LINK FROM GRISS, TTY 15
TOPS-20 Command processor 4(714)-2
End of COMAND.CMD.8
@<pslλ$Jλ$Jλ$Jlanguages>rlisp
[Keeping]
REDUCE 2 (University of Utah, Nov-23-81) [RLISP] ...
on 1) comp,plap,pgwd;
NIL
2) copreλ$Jλ$Jλ$Jre 80;
3) in tak16.sl;
(SETQ !*COMP T)
T
(SETQ !*PLAP T)
T
(SETQ !*PGWD T)
T
(de tak (x y z)
(cond ((null (Lessp y x)) z)
(t (tak (tak (sub1 x) y z)
(tak (sub1 y) z x)
(tak (sub1 z) x y)))))
(!*ENTRY TAK EXPR 3)
(!*ALLOC 5)
(!*LBL G0013)
(!*STORE 1 0)
(!*STORE 2 -1)
(!*STORE 3 -2)
(!*LOAD 2 1)
(!*LOAD 1 -1)
(!*LINK LESSP EXPR 2)
(!*JUMPNIL G0014)
(!*LOAD 1 0)
(!*LINK SUB1 EXPR 1)
(!*LOAD 3 -2)
(!*LOAD 2 -1)
(!*LINK TAK EXPR 3)
(!*STORE 1 -3)
(!*LOAD 1 -1)
(!*LINK SUB1 EXPR 1)
(!*LOAD 3 0)
(!*LOAD 2 -2)
(!*LINK TAK EXPR 3)
(!*STORE 1 -4)
(!*LOAD 1 -2)
(!*LINK SUB1 EXPR 1)
(!*LOAD 3 -1)
(!*LOAD 2 0)
(!*LINK TAK EXPR 3)
(!*LOAD 3 1)
(!*LOAD 2 -4)
(!*LOAD 1 -3)
(!*JUMP G0013)
(!*LBL G0014)
(!*LOAD 1 -2)
(!*DEALLOC 5)
(!*EXIT)
(!*ENTRY TAK EXPR 3)
(ADD P (C 0 0 5 5)) 270600000000
(213 P 85 16) 325620000125
G0013
(MOVEM 1 0 P) 202054000000
(MOVEM 2 -1 P) 202114777777
(MOVEM 3 -2 P) 202154777776
(MOVE 2 1) 200100000001
(MOVE 1 -1 P) 200054777777
(CALL 2 (E LESSP)) 34100021172
(JUMPE 1 G0014) 322040000000
(MOVE 1 0 P) 200054000000
(CALL 1 (E SUB1)) 34040016100
(MOVE 3 -2 P) 200154777776
(MOVE 2 -1 P) 200114777777
(CALL 3 (E TAK)) 34140163345
(MOVEM 1 -3 P) 202054777775
(MOVE 1 -1 P) 200054777777
(CALL 1 (E SUB1)) 34040016100
(MOVE 3 0 P) 200154000000
(MOVE 2 -2 P) 200114777776
(CALL 3 (E TAK)) 34140163345
(MOVEM 1 -4 P) 202054777774
(MOVE 1 -2 P) 200054777776
(CALL 1 (E SUB1)) 34040016100
(MOVE 3 -1 P) 200154777777
(MOVE 2 0 P) 200114000000
(CALL 3 (E TAK)) 34140163345
(MOVE 3 1) 200140000001
(MOVE 2 -4 P) 200114777774
(MOVE 1 -3 P) 200054777775
(JRST 0 G0013) 254000433520
G0014
(MOVE 1 -2 P) 200054777776
(SUB P (C 0 0 5 5)) 274600000000
(POPJ P) 263600000000
*** TAK 145230 BASE 33 WORDS 83599 LEFT
(0 0 5 5) 5000005
TAK
(SETQ !*TIME T)
T
TIME: 1878 MS
% Turn on Time loop
% Slow Links
(TAK 1 1 1)
1
TIME: 65 MS
(TAK 18 12 6)
7
TIME: 4977 MS
% fast links
(SETQ !*NOUUO NIL)
NIL
TIME: 66 MS
(TAK 1 1 1)
1
TIME: 54 MS
(TAK 18 12 6)
7
TIME: 1102 MS
NIL
TIME: 62 MS
4) quit;
@pop
[PHOTO: Recording terminated Wed 9-Dec-81 5:26AM]
PS, Cna you send me the S-1 code or some such; maybe we can learn some
new tricks.
-------
∂11-Dec-81 1125 Griss at UTAH-20 (Martin.Griss)
Date: 11 Dec 1981 1222-MST
From: Griss at UTAH-20 (Martin.Griss)
To: RPG at SU-AI
cc: Griss at UTAH-20
In-Reply-To: Your message of 11-Dec-81 1212-MST
Here is TAK.PHT; I would appreciate comments/suggestions on code.
We have been rather pressed for time (me hunting funding etc), so
havent speent the needed hours stdying the code sequences. We want VAX
to stabilize so I can run first PSL class next month; hacking like mad
as PSL manual, uitility modules, editor, emode, windows, packages....
---------------------------------------
[PHOTO: Recording initiated Wed 9-Dec-81 5:43AM]
LINK FROM GRISS, TTY 15
TOPS-20 Command processor 4(714)-2
End of COMAND.CMD.8
@psl:rlisp
[Keeping]
REDUCE 2 (RLisp, 1 December 81) ...
1> % LOAD SOME IMPROVED ARITH
1> IN "ARITH-TEST.RED"$%λ$J
NIL
NIL
NIL
*** (TIMERLOOP): base 562401, length 32
TIMERLOOP
*** (AVG): base 562443, length 14
AVG
*** (TESTLOOP): base 562464, length 15
TESTLOOP
*** (ITESTLOOP): base 562514, length 15
ITESTLOOP
*** (WQUOTE): base 562536, length 6
WQUOTE
FASTPLUS2
FASTTIMES2
FASTDIFFERENCE
FASTADD1
FASTSUB1
FASTZEROP
FASTMINUSP
FASTGREATERP
FASTLESSP
NIL
*** (FASTTESTLOOP): base 562613, length 13
FASTTESTLOOP
NIL
NIL
*** (WTESTLOOP): base 562635, length 12
WTESTLOOP
*** (CALL1): base 562656, length 14
CALL1
*** (CALL2): base 562701, length 14
CALL2
*** (FOO1): base 562717, length 1
FOO1
*** (FOO2): base 562720, length 5
FOO2
NIL
*** (WQUOTE): base 562725, length 6
*** Function `WQUOTE' has been redefined
WQUOTE
*** (IARITHERROR): base 562737, length 4
IARITHERROR
NIL
*** (IPLUS2): base 562746, length 15
IPLUS2
*** (ITIMES2): base 562770, length 14
ITIMES2
*** (IDIFFERENCE): base 563016, length 14
IDIFFERENCE
*** (IADD1): base 563037, length 10
IADD1
*** (ISUB1): base 563051, length 10
ISUB1
*** (IZEROP): base 563066, length 12
IZEROP
*** (IMINUSP): base 563105, length 12
IMINUSP
*** (IGREATERP): base 563124, length 17
IGREATERP
*** (ILESSP): base 563145, length 17
ILESSP
NIL
2> IN "TAK.SL'λ$J";
(SETQ !*COMP T)T
% get compiled and code listing
(SETQ !*PLAP T)T
(SETQ !*PGWD T)T
% Using Generic Arith (we believe slower than should be)
(de tak (x y z)
(cond ((null (Lessp y x)) z)
(t (tak (tak (sub1 x) y z)
(tak (sub1 y) z x)
(tak (sub1 z) x y)))))(!*ENTRY TAK EXPR 3)
(!*ALLOC 5)
(!*LBL G0002)
(!*STORE 1 0)
(!*STORE 2 -1)
(!*STORE 3 -2)
(!*JUMPWLESSP G0004 2 1)
(!*LOAD 1 3)
(!*JUMP G0001)
(!*LBL G0004)
(!*LOAD 1 0)
(!*LINK SUB1 EXPR 1)
(!*LOAD 3 -2)
(!*LOAD 2 -1)
(!*LINK TAK EXPR 3)
(!*STORE 1 -3)
(!*LOAD 1 -1)
(!*LINK SUB1 EXPR 1)
(!*LOAD 3 0)
(!*LOAD 2 -2)
(!*LINK TAK EXPR 3)
(!*STORE 1 -4)
(!*LOAD 1 -2)
(!*LINK SUB1 EXPR 1)
(!*LOAD 3 -1)
(!*LOAD 2 0)
(!*LINK TAK EXPR 3)
(!*LOAD 3 1)
(!*LOAD 2 -4)
(!*LOAD 1 -3)
(!*JUMP G0002)
(!*LBL G0001)
(!*EXIT 5)
(ADJSP ST 5) 105 17 0 00 000005
(MOVEM 1 0 ST) 202 01 0 17 000000
(MOVEM 2 -1 ST) 202 02 0 17 777777
(MOVEM 3 -2 ST) 202 03 0 17 777776
(CAMGE 2 1) 315 02 0 00 000001
(JRST 0 G0004) 254 00 0 00 563200
(MOVE 1 3) 200 01 0 00 000003
(JRST 0 G0001) 254 00 0 00 563225
(MOVE 1 0 ST) 200 01 0 17 000000
(PUSHJ ST (E SUB1)) 260 17 0 00 342453
(MOVE 3 -2 ST) 200 03 0 17 777776
(MOVE 2 -1 ST) 200 02 0 17 777777
(PUSHJ ST (E TAK)) 260 17 0 00 347356
(MOVEM 1 -3 ST) 202 01 0 17 777775
(MOVE 1 -1 ST) 200 01 0 17 777777
(PUSHJ ST (E SUB1)) 260 17 0 00 342453
(MOVE 3 0 ST) 200 03 0 17 000000
(MOVE 2 -2 ST) 200 02 0 17 777776
(PUSHJ ST (E TAK)) 260 17 0 00 347356
(MOVEM 1 -4 ST) 202 01 0 17 777774
(MOVE 1 -2 ST) 200 01 0 17 777776
(PUSHJ ST (E SUB1)) 260 17 0 00 342453
(MOVE 3 -1 ST) 200 03 0 17 777777
(MOVE 2 0 ST) 200 02 0 17 000000
(PUSHJ ST (E TAK)) 260 17 0 00 347356
(MOVE 3 1) 200 03 0 00 000001
(MOVE 2 -4 ST) 200 02 0 17 777774
(MOVE 1 -3 ST) 200 01 0 17 777775
(JRST 0 G0002) 254 00 0 00 563171
(ADJSP ST -5) 105 17 0 00 777773
(POPJ ST 0) 263 17 0 00 000000
*** (TAK): base 563170, length 31
TAK
% Using a "quick and dirty" Inum Only Arith (does do calls and checks
% of range
(de Itak (x y z)
(cond ((null (ILessp y x)) z)
(t (Itak (Itak (Isub1 x) y z)
(Itak (Isub1 y) z x)
(Itak (Isub1 z) x y)))))(!*ENTRY ITAK EXPR 3)
(!*ALLOC 5)
(!*LBL G0002)
(!*STORE 1 0)
(!*STORE 2 -1)
(!*STORE 3 -2)
(!*LOAD 2 1)
(!*LOAD 1 -1)
(!*LINK ILESSP EXPR 2)
(!*JUMPNOTEQ G0004 1 (QUOTE NIL))
(!*LOAD 1 -2)
(!*JUMP G0001)
(!*LBL G0004)
(!*LOAD 1 0)
(!*LINK ISUB1 EXPR 1)
(!*LOAD 3 -2)
(!*LOAD 2 -1)
(!*LINK ITAK EXPR 3)
(!*STORE 1 -3)
(!*LOAD 1 -1)
(!*LINK ISUB1 EXPR 1)
(!*LOAD 3 0)
(!*LOAD 2 -2)
(!*LINK ITAK EXPR 3)
(!*STORE 1 -4)
(!*LOAD 1 -2)
(!*LINK ISUB1 EXPR 1)
(!*LOAD 3 -1)
(!*LOAD 2 0)
(!*LINK ITAK EXPR 3)
(!*LOAD 3 1)
(!*LOAD 2 -4)
(!*LOAD 1 -3)
(!*JUMP G0002)
(!*LBL G0001)
(!*EXIT 5)
(ADJSP ST 5) 105 17 0 00 000005
(MOVEM 1 0 ST) 202 01 0 17 000000
(MOVEM 2 -1 ST) 202 02 0 17 777777
(MOVEM 3 -2 ST) 202 03 0 17 777776
(MOVE 2 1) 200 02 0 00 000001
(MOVE 1 -1 ST) 200 01 0 17 777777
(PUSHJ ST (E ILESSP)) 260 17 0 00 347320
(CAME 1 NIL) 312 01 0 00 000000
(JRST 0 G0004) 254 00 0 00 563244
(MOVE 1 -2 ST) 200 01 0 17 777776
(JRST 0 G0001) 254 00 0 00 563271
(MOVE 1 0 ST) 200 01 0 17 000000
(PUSHJ ST (E ISUB1)) 260 17 0 00 347321
(MOVE 3 -2 ST) 200 03 0 17 777776
(MOVE 2 -1 ST) 200 02 0 17 777777
(PUSHJ ST (E ITAK)) 260 17 0 00 347357
(MOVEM 1 -3 ST) 202 01 0 17 777775
(MOVE 1 -1 ST) 200 01 0 17 777777
(PUSHJ ST (E ISUB1)) 260 17 0 00 347321
(MOVE 3 0 ST) 200 03 0 17 000000
(MOVE 2 -2 ST) 200 02 0 17 777776
(PUSHJ ST (E ITAK)) 260 17 0 00 347357
(MOVEM 1 -4 ST) 202 01 0 17 777774
(MOVE 1 -2 ST) 200 01 0 17 777776
(PUSHJ ST (E ISUB1)) 260 17 0 00 347321
(MOVE 3 -1 ST) 200 03 0 17 777777
(MOVE 2 0 ST) 200 02 0 17 000000
(PUSHJ ST (E ITAK)) 260 17 0 00 347357
(MOVE 3 1) 200 03 0 00 000001
(MOVE 2 -4 ST) 200 02 0 17 777774
(MOVE 1 -3 ST) 200 01 0 17 777775
(JRST 0 G0002) 254 00 0 00 563232
(ADJSP ST -5) 105 17 0 00 777773
(POPJ ST 0) 263 17 0 00 000000
*** (ITAK): base 563231, length 34
ITAK
% "quick and dirty(?)" use of SYSLISP arith, all in line, full
% Fixnum range.
% Could be made into (UNBOX) (Wo ...) (BOX) for "fast-arith"
(dm Wsub1 (X) (LIST 'Wdifference (CADR X) '(WCONST 1)))(!*ENTRY WSUB1 MACRO
1)
(!*ALLOC 0)
(!*LOAD 3 (QUOTE (WCONST 1)))
(!*LOAD 2 (CAR (CDR 1)))
(!*LOAD 1 (QUOTE WDIFFERENCE))
(!*LINKE 0 LIST3 EXPR 3)
(MOVE 3 115245) 200 03 0 00 341055
(MOVE 2 1 1) 200 02 0 01 000001
(MOVE 2 0 2) 200 02 0 02 000000
(MOVE 1 (LAPCONSTANT 0)) 200 01 0 00 563303
(JRST 0 (E LIST3)) 254 00 0 00 342401
:LAPCONSTANT 0: 000 00 0 04 003336
*** (WSUB1): base 563276, length 6
WSUB1
(de Wtak (x y z)
(cond ((null (WLessp y x)) z)
(t (Wtak (Wtak (Wsub1 x) y z)
(Wtak (Wsub1 y) z x)
(Wtak (Wsub1 z) x y)))))(!*ENTRY WTAK EXPR 3)
(!*ALLOC 5)
(!*LBL G0002)
(!*STORE 1 0)
(!*STORE 2 -1)
(!*STORE 3 -2)
(!*JUMPWLESSP G0004 2 1)
(!*LOAD 1 3)
(!*JUMP G0001)
(!*LBL G0004)
(!*LOAD 3 -2)
(!*LOAD 2 -1)
(!*LOAD 1 0)
(!*WPLUS2 1 (WCONST -1))
(!*LINK WTAK EXPR 3)
(!*STORE 1 -3)
(!*LOAD 3 0)
(!*LOAD 2 -2)
(!*LOAD 1 -1)
(!*WPLUS2 1 (WCONST -1))
(!*LINK WTAK EXPR 3)
(!*STORE 1 -4)
(!*LOAD 3 -1)
(!*LOAD 2 0)
(!*LOAD 1 -2)
(!*WPLUS2 1 (WCONST -1))
(!*LINK WTAK EXPR 3)
(!*LOAD 3 1)
(!*LOAD 2 -4)
(!*LOAD 1 -3)
(!*JUMP G0002)
(!*LBL G0001)
(!*EXIT 5)
(ADJSP ST 5) 105 17 0 00 000005
(MOVEM 1 0 ST) 202 01 0 17 000000
(MOVEM 2 -1 ST) 202 02 0 17 777777
(MOVEM 3 -2 ST) 202 03 0 17 777776
(CAMGE 2 1) 315 02 0 00 000001
(JRST 0 G0004) 254 00 0 00 563316
(MOVE 1 3) 200 01 0 00 000003
(JRST 0 G0001) 254 00 0 00 563343
(MOVE 3 -2 ST) 200 03 0 17 777776
(MOVE 2 -1 ST) 200 02 0 17 777777
(MOVE 1 0 ST) 200 01 0 17 000000
(SOJ 1 0) 360 01 0 00 000000
(PUSHJ ST (E WTAK)) 260 17 0 00 347361
(MOVEM 1 -3 ST) 202 01 0 17 777775
(MOVE 3 0 ST) 200 03 0 17 000000
(MOVE 2 -2 ST) 200 02 0 17 777776
(MOVE 1 -1 ST) 200 01 0 17 777777
(SOJ 1 0) 360 01 0 00 000000
(PUSHJ ST (E WTAK)) 260 17 0 00 347361
(MOVEM 1 -4 ST) 202 01 0 17 777774
(MOVE 3 -1 ST) 200 03 0 17 777777
(MOVE 2 0 ST) 200 02 0 17 000000
(MOVE 1 -2 ST) 200 01 0 17 777776
(SOJ 1 0) 360 01 0 00 000000
(PUSHJ ST (E WTAK)) 260 17 0 00 347361
(MOVE 3 1) 200 03 0 00 000001
(MOVE 2 -4 ST) 200 02 0 17 777774
(MOVE 1 -3 ST) 200 01 0 17 777775
(JRST 0 G0002) 254 00 0 00 563307
(ADJSP ST -5) 105 17 0 00 777773
(POPJ ST 0) 263 17 0 00 000000
*** (WTAK): base 563306, length 31
WTAK
(SETQ !*TIME T)T
TIME: 7053 MS
% Turn on Time loop
(TAK 1 1 1)1
TIME: 28 MS
(SYS2INT
(WTAK (INT2SYS 1) (INT2SYS 1) (INT2SYS 1)))1
TIME: 69 MS
(TAK 18 12 6)7
TIME: 1672 MS
(SYS2INT
(WTAK (INT2SYS 18) (INT2SYS 12) (INT2SYS 6)))7
TIME: 526 MS
(ITAK 18 12 6)7
TIME: 1077 MS
NIL
TIME: 36 MS
3> QUIT;
@POP
[PHOTO: Recording terminated Wed 9-Dec-81 5:45AM]
-------
;;; MacLisp produced LAP
(LAP TAK SUBR)
(ARGS TAK (() . 3))
(PUSH P 1)
(PUSH P 2)
(PUSH P 3)
(MOVE 7 0 2)
(CAMGE 7 0 1)
(JRST 0 G0002)
(MOVEI 1 0 3)
(JSP T PDLNMK)
(JRST 0 G0001)
G0002
(MOVE 7 0 1)
(SUBI 7 1)
(PUSH FXP 7)
(MOVEI 1 0 FXP)
(CALL 3 'TAK)
(MOVE 7 @ -1 P)
(SUBI 7 1)
(MOVE 3 -2 P)
(MOVE 2 0 P)
(PUSH P 1)
(PUSH FXP 7)
(MOVEI 1 0 FXP)
(CALL 3 'TAK)
(MOVE 7 @ -1 P)
(SUBI 7 1)
(MOVE 3 -2 P)
(MOVE 2 -3 P)
(PUSH P 1)
(PUSH FXP 7)
(MOVEI 1 0 FXP)
(CALL 3 'TAK)
(MOVEI 3 0 1)
(POP P 2)
(POP P 1)
(CALL 3 'TAK)
(SUB FXP (% 0 0 3 3))
G0001
(SUB P (% 0 0 3 3))
(POPJ P)
()
∂26-Feb-81 2227 CSVAX.fateman at Berkeley
Date: 26 Feb 1981 14:42:52-PST
From: CSVAX.fateman at Berkeley
To: CSVAX.jkf@Berkeley, jlk@mit-mc, lisp-forum@mit-mc, rz@mit-mc
Cc: CSVAX.fateman@Berkeley
←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
| | UCILISP | INTERLISP | MACLISP |Franz/VAX|
|-------------+---------+-----------+---------+---------|
| Interpreter | 57.0 | 26.0 | 22.8 | 65.0 |
|-------------+---------+-----------+---------+---------|
| Compiler | 2.90 | 15.0 | 0.69 | 1.1 ** |
|-------------+---------+-----------+---------+---------|
Times are for (TAK 4 2 0), where TAK is an interesting function
defined by Mr. Ikuo Takeuchi.
(DEFUN TAK (X Y Z)
(COND ((GREATERP X Y)
(TAK (TAK (SUB1 X) Y Z)
(TAK (SUB1 Y) Z X)
(TAK (SUB1 Z) X Y) ))
(T Y) ))
(**) 5.3 with (1- x) etc [no other declarations, so greaterp is closed comp.]
4.1 with local function declaration (fast subroutine call)
1.1 with > open compiled
times on a VAX 11/780 at Berkeley, Feb. 26, 1981
∂22-Jan-82 1656 Griss at UTAH-20 (Martin.Griss) Latest V2 VAx times
Date: 22 Jan 1982 1751-MST
From: Griss at UTAH-20 (Martin.Griss)
Subject: Latest V2 VAx times
To: rpg at SU-AI
cc: griss at UTAH-20
With a new scheme of VAX tags, and recent compiler/optimizer improvements,
on our 11/750 we find for (TAK 18 12 6) [unlesswe have an error??]
PSL ordinary ("generic") arith 7.1 sec
Franz ordinary arith 19.9 sec
PSL INUM arith 1.4
C 2.4
Franz Fixnum 3.6 sec
I think numbers agree with Diablo times *2/3. We expect better ratio on 11/780,
since registers are faster!
In our V2 VAX model, LISP INUMS are tagged 0 and -1, ie, are signed 32 numbers in
27 bit range, hence are actually SYSLISP numbers, ie this is "our" fixnum mode.
Our 7.1 is so much better than Franz 19.9, since we are in INUM range, no
storage alloc at all.
We are getting better.....
I will bring latest PSL manual for you.
-------
∂23-Jan-82 0931 Griss at UTAH-20 (Martin.Griss) Rep to george
Date: 23 Jan 1982 1027-MST
From: Griss at UTAH-20 (Martin.Griss)
Subject: Rep to george
To: rpg at SU-AI
cc: griss at UTAH-20
I sent following reposnse to Charrette:
[Is the table correctly repseneting what you did with TAK]
George:
We have just gotten our second version of VAX PSL running. It is not fully
checked out (just came up last night). It is complete enough to do some
preliminary timings. As you may recall, V1 VAX PSL was comparable in speed
to Franz LISP on our 11/750 under Unix. We have improved arithmetic and
some code generation for the second build.
V2 PSL has a new tagging scheme that gives 28 bit INUMS; i.e. INUMS are
now the same as SYSLISP-integers in the previous model, so that we won't
need to use SYSLISP level integers as much. The new V2 is roughly twice as
fast as V1, i.e. appears faster than Franz (tests still incomplete, please
don't quote yet).
We redid the (TAK 18 12 6) measurements requested by Dick Gabriel, and here
is a summary:
DEC-20/60:
Ordinary LISP1.6 arith 1.1sec
Ordinary PSL arith 1.67
Inum (fast) PSL arith 1.08
SYSLISP arith .526
C (New Utah PCC Implementaton) .977 [ie SYSLISP faster than C here]
VAX 11/750:
PSL V2, ordinary arith 7.1
PSL V2, Inum arith 1.4 [inum =syslisp on VAX now]
Franz, ordinary arith 19.9
Franz, Fixnum arith 3.6 [using 1+, 1-, * etc in Franz]
C on VAX 2.4
Some reference points from Gabriel:
Dolphin 11.1
MIT CADR 3.1
Franz, Fixnum,11/780 2.1 [Diablo at Stanford]
68000 (C) 1.9
C on 11/780 1.35
SAIL Maclisp .83 ( ~.66 on DEC-20/60?)
SAIL "bummed" MACLISP .80
68000 machine code .7
SAIL machine code .184
SCORE machine code .162
S-1 machine code .114
The best MACLISP and machine code times involved open-coded
FIXNUM arithmetic, hand-unfolding of LISP recursion, and
hand-register allocation. Most of this is one automatically in
the PSL compiler.
Do you have some VAX NIL times for TAK. If you make changes from the
simple
(DEFUN TAK (X Y Z)
(COND ((NULL (lessp Y X)) Z)
(T (TAK (TAK (sub1 X) Y Z)
(TAK (sub1 Y) Z X)
(TAK (sub1 Z) X Y)))))
with "lessp" and "sub1" being different closed or open arithmetics (eg
LESSP, SUB1 or < and 1-), such as special declarations, please send
compilation conditions, declarations , sample of code. I think TAK is a bit
small to be representative, but it does show function call and arithmetic
speed.
@begin(MediumFlame)
By the way, I resent a minor implication of your explanation for the use of
Scheme to Unix for NIL VM: that others may use C, but "at MIT we have do
better/more interesting stuff"; we at UTAH may be "in the boon-docks", but
we "ain't hicks".
Our VM is written in PSL itself, since we believe PSL is good enough for
ALL facets of the work, we dont have to resort to another language.
Our PSL to machine compiler has a conventional LISP->LAP step(3 passes),
[with a very powerful, extensible, table-driven LAP]. The LAP
is then either emitted to a file, assembled and deposited in line
(resident PSL compiler), or passed to a LAP to assembly code translator.
Thus on the VAX we build our VM (kernel) by writing kernel code in PSL,
and compiling to UNIX assembler, on the DEC-20 we produce MIDAS, and
for the 68000 Apollo, we produce ASM.
I realize that PSL is not as grandiose a LISP as NIL, since our goals are
to write and maintain a reasonable LISP for DEC-20, VAX, and 68000 that is
efficient, quick to change and experiment with, powerful enough to be used
for Algebra, Graphics and VLSI research, yet managed by 2-3 g